package com.xplay.xpocker.util;

public abstract class Assertion {

    protected static void throwException(String message) {
        throw new RuntimeException(message);
    }

    public static void isNull(Object object, String message, Object... params) {
        if (!ObjectUtils.notNull(object)) {
            throwException(String.format(message, params));
        }
    }

    public static void isTrue(boolean object, String message, Object... params) {
        if (object) {
            throwException(String.format(message, params));
        }
    }

    public static void isEmpty(Object object, String message, Object... params) {
        if (ObjectUtils.isEmpty(object)) {
            throwException(String.format(message, params));
        }
    }


    public static void notEmpty(Object object, String message, Object... params) {
        if (!ObjectUtils.isEmpty(object)) {
            throwException(String.format(message, params));
        }
    }
}
